// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package sso_connector

import (
	"context"

	"github.com/cloudflare/cloudflare-go/v6"
	"github.com/cloudflare/cloudflare-go/v6/iam"
	"github.com/cloudflare/terraform-provider-cloudflare/internal/customfield"
	"github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes"
	"github.com/hashicorp/terraform-plugin-framework/diag"
	"github.com/hashicorp/terraform-plugin-framework/types"
)

type SSOConnectorResultDataSourceEnvelope struct {
	Result SSOConnectorDataSourceModel `json:"result,computed"`
}

type SSOConnectorDataSourceModel struct {
	ID                 types.String                                                      `tfsdk:"id" path:"sso_connector_id,computed"`
	SSOConnectorID     types.String                                                      `tfsdk:"sso_connector_id" path:"sso_connector_id,required"`
	AccountID          types.String                                                      `tfsdk:"account_id" path:"account_id,required"`
	CreatedOn          timetypes.RFC3339                                                 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
	EmailDomain        types.String                                                      `tfsdk:"email_domain" json:"email_domain,computed"`
	Enabled            types.Bool                                                        `tfsdk:"enabled" json:"enabled,computed"`
	UpdatedOn          timetypes.RFC3339                                                 `tfsdk:"updated_on" json:"updated_on,computed" format:"date-time"`
	UseFedrampLanguage types.Bool                                                        `tfsdk:"use_fedramp_language" json:"use_fedramp_language,computed"`
	Verification       customfield.NestedObject[SSOConnectorVerificationDataSourceModel] `tfsdk:"verification" json:"verification,computed"`
}

func (m *SSOConnectorDataSourceModel) toReadParams(_ context.Context) (params iam.SSOGetParams, diags diag.Diagnostics) {
	params = iam.SSOGetParams{
		AccountID: cloudflare.F(m.AccountID.ValueString()),
	}

	return
}

type SSOConnectorVerificationDataSourceModel struct {
	Code   types.String `tfsdk:"code" json:"code,computed"`
	Status types.String `tfsdk:"status" json:"status,computed"`
}
